package com.bana.fvs.app.mvp.model;

import android.app.Activity;

import com.bana.fvs.app.mvp.ConstantsValue;
import com.bana.fvs.app.mvp.contract.EquipListContract;
import com.wei.commonlibrary.net.OkhttpRequest;

import java.util.HashMap;

/**
 * Author : yanftch
 * Date : 2018/3/2
 * Time : 22:41
 * Desc :
 */

public class EquipListModel extends EquipListContract.AbsEquipListModel {
    @Override
    public void onStart() {

    }

    @Override
    public OkhttpRequest http_controlVisibility(Activity activity, String token, String sbbm, String kzcz) {
        HashMap<String, Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN, token);
        map.put(ConstantsValue.SBBM, sbbm);//
        map.put(ConstantsValue.KZCZ, kzcz);//
        return okhttpRequest.url(iApiService.visibDetectCtrl(map));
    }

    @Override
    public OkhttpRequest http_controlController(Activity activity, String token, String sbbm, String kzcz) {
        HashMap<String, Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN, token);
        map.put(ConstantsValue.SBBM, sbbm);//
        map.put(ConstantsValue.KZCZ, kzcz);//
        return okhttpRequest.url(iApiService.areaEquipCtrl(map));
    }

    @Override
    public OkhttpRequest http_controlLamp(Activity activity, String token, String sbbm, String kzcz) {
        HashMap<String, Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN, token);
        map.put(ConstantsValue.SBBM, sbbm);//
        map.put(ConstantsValue.KZCZ, kzcz);//
        return okhttpRequest.url(iApiService.foglightCtrl(map));
    }

    @Override
    public OkhttpRequest http_getEquipList(Activity activity, String token, String sblx, String sbzt, String wqbm, int pagenum) {
//        {
//            "token":"YWRtaW58MHxudWxsfG51bGx8MHxudWxsfDE1MzEyMDgxMDgxNjQ=",
//                "data":
//            {
//                "wqbm":0
//
//            }
//
//
//        }

        HashMap<String, Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN, token);
//        map.put(ConstantsValue.SBLX, sblx);//设备类型
//        map.put(ConstantsValue.SBZT, sbzt);//
//        map.put(ConstantsValue.WQBM, wqbm);//
//        map.put(ConstantsValue.PAGENUM, pagenum);//
//        map.put(ConstantsValue.PAGESIZE,20);

        HashMap<String,String> data=new HashMap<>();
        data.put(ConstantsValue.WQBM,wqbm);
        map.put("data",data);

        return okhttpRequest.url(iApiService.getEquipList(map));
    }
}
